<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>mjs</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="mjs"></a>mjs</h1><div class=CBody><p>Vector and Matrix math utilities for JavaScript, optimized for WebGL.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#mjs" >mjs</a></td><td class=SDescription>Vector and Matrix math utilities for JavaScript, optimized for WebGL.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#MJS_VERSION" >MJS_VERSION</a></td><td class=SDescription>0xaabbcc.</td></tr><tr class="SConstant SIndent1"><td class=SEntry><a href="#MJS_DO_ASSERT" >MJS_DO_ASSERT</a></td><td class=SDescription>Enables or disables runtime assertions.</td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#MJS_FLOAT_ARRAY_TYPE" >MJS_FLOAT_ARRAY_TYPE</a></td><td class=SDescription>The base float array type. </td></tr><tr class="SClass"><td class=SEntry><a href="#V3" >V3</a></td><td class=SDescription>Methods for working with 3-element vectors. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#V3.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#V3.V3.$" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">V3.$</a></td><td class=SDescription>Creates a new 3-element vector with the given values.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#V3.V3.clone" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">V3.<wbr>clone</a></td><td class=SDescription>Clone the given 3-element vector.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#V3.V3.add" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">V3.add</a></td><td class=SDescription>Perform r = a + b.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#V3.V3.sub" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">V3.sub</a></td><td class=SDescription>Perform r = a - b.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#V3.V3.neg" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">V3.neg</a></td><td class=SDescription>Perform r = - a.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#V3.V3.direction" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">V3.<wbr>direction</a></td><td class=SDescription>Perform r = (a - b) / |a - b|. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#V3.V3.length" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">V3.<wbr>length</a></td><td class=SDescription>Perform r = |a|.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#V3.V3.lengthSquard" >V3.<wbr>lengthSquard</a></td><td class=SDescription>Perform r = |a|*|a|.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#V3.V3.normalize" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">V3.<wbr>normalize</a></td><td class=SDescription>Perform r = a / |a|.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#V3.V3.scale" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">V3.<wbr>scale</a></td><td class=SDescription>Perform r = a * k.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#V3.V3.dot" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">V3.dot</a></td><td class=SDescription>Perform r = dot(a, b).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#V3.V3.cross" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">V3.<wbr>cross</a></td><td class=SDescription>Perform r = a x b.</td></tr><tr class="SClass"><td class=SEntry><a href="#M4x4" >M4x4</a></td><td class=SDescription>Methods for working with 4x4 matrices. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#M4x4.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.$" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">M4x4.$</a></td><td class=SDescription>Creates a new 4x4 matrix with the given values.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.clone" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">M4x4.<wbr>clone</a></td><td class=SDescription>Clone the given 4x4 matrix.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.topLeft3x3" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">M4x4.<wbr>topLeft3x3</a></td><td class=SDescription>Return the top left 3x3 matrix from the given 4x4 matrix m.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.inverseOrthonormal" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">M4x4.<wbr>inverseOrthonormal</a></td><td class=SDescription>Computes the inverse of the given matrix m, assuming that the matrix is orthonormal.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.inverseTo3x3" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">M4x4.<wbr>inverseTo3x3</a></td><td class=SDescription>Computes the inverse of the given matrix m, but calculates only the top left 3x3 values of the result.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.makeFrustum" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">M4x4.<wbr>makeFrustum</a></td><td class=SDescription>Creates a matrix for a projection frustum with the given parameters.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makePerspective" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">M4x4.<wbr>makePerspective</a></td><td class=SDescription>Creates a matrix for a perspective projection with the given parameters.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.makeOrtho" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">M4x4.<wbr>makeOrtho</a></td><td class=SDescription>Creates a matrix for an orthogonal frustum projection with the given parameters.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeOrtho" id=link20 onMouseOver="ShowTip(event, 'tt19', 'link20')" onMouseOut="HideTip('tt19')">M4x4.<wbr>makeOrtho</a></td><td class=SDescription>Creates a matrix for a 2D orthogonal frustum projection with the given parameters. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.mul" id=link21 onMouseOver="ShowTip(event, 'tt20', 'link21')" onMouseOut="HideTip('tt20')">M4x4.mul</a></td><td class=SDescription>Performs r = a * b.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeRotate" id=link22 onMouseOver="ShowTip(event, 'tt21', 'link22')" onMouseOut="HideTip('tt21')">M4x4.<wbr>makeRotate</a></td><td class=SDescription>Creates a transformation matrix for rotation by angle radians about the 3-element vector axis.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.rotate" id=link23 onMouseOver="ShowTip(event, 'tt22', 'link23')" onMouseOut="HideTip('tt22')">M4x4.<wbr>rotate</a></td><td class=SDescription>Concatenates a rotation of angle radians about the axis to the give matrix m.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeScale3" id=link24 onMouseOver="ShowTip(event, 'tt23', 'link24')" onMouseOut="HideTip('tt23')">M4x4.<wbr>makeScale3</a></td><td class=SDescription>Creates a transformation matrix for scaling by 3 scalar values, one for each of the x, y, and z directions.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.makeScale1" id=link25 onMouseOver="ShowTip(event, 'tt24', 'link25')" onMouseOut="HideTip('tt24')">M4x4.<wbr>makeScale1</a></td><td class=SDescription>Creates a transformation matrix for a uniform scale by a single scalar value.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeScale" id=link26 onMouseOver="ShowTip(event, 'tt25', 'link26')" onMouseOut="HideTip('tt25')">M4x4.<wbr>makeScale</a></td><td class=SDescription>Creates a transformation matrix for scaling each of the x, y, and z axes by the amount given in the corresponding element of the 3-element vector.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.scale3" id=link27 onMouseOver="ShowTip(event, 'tt26', 'link27')" onMouseOut="HideTip('tt26')">M4x4.<wbr>scale3</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.scale1" id=link28 onMouseOver="ShowTip(event, 'tt27', 'link28')" onMouseOut="HideTip('tt27')">M4x4.<wbr>scale1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.scale1" >M4x4.<wbr>scale1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeTranslate3" id=link29 onMouseOver="ShowTip(event, 'tt28', 'link29')" onMouseOut="HideTip('tt28')">M4x4.<wbr>makeTranslate3</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.makeTranslate1" id=link30 onMouseOver="ShowTip(event, 'tt29', 'link30')" onMouseOut="HideTip('tt29')">M4x4.<wbr>makeTranslate1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeTranslate" id=link31 onMouseOver="ShowTip(event, 'tt30', 'link31')" onMouseOut="HideTip('tt30')">M4x4.<wbr>makeTranslate</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.translate3" id=link32 onMouseOver="ShowTip(event, 'tt31', 'link32')" onMouseOut="HideTip('tt31')">M4x4.<wbr>translate3</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.translate1" id=link33 onMouseOver="ShowTip(event, 'tt32', 'link33')" onMouseOut="HideTip('tt32')">M4x4.<wbr>translate1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.translate" id=link34 onMouseOver="ShowTip(event, 'tt33', 'link34')" onMouseOut="HideTip('tt33')">M4x4.<wbr>translate</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeLookAt" id=link35 onMouseOver="ShowTip(event, 'tt34', 'link35')" onMouseOut="HideTip('tt34')">M4x4.<wbr>makeLookAt</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#M4x4.M4x4.transpose" id=link36 onMouseOver="ShowTip(event, 'tt35', 'link36')" onMouseOut="HideTip('tt35')">M4x4.<wbr>transpose</a></td><td class=SDescription></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Constants"></a>Constants</h3></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="MJS_VERSION"></a>MJS_VERSION</h3><div class=CBody><h4 class=CHeading>mjs version number aa.bb.cc, encoded as an integer of the form</h4><p>0xaabbcc.</p></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="MJS_DO_ASSERT"></a>MJS_DO_ASSERT</h3><div class=CBody><p>Enables or disables runtime assertions.</p><p>For potentially more performance, the assert methods can be commented out in each place where they are called.</p></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="MJS_FLOAT_ARRAY_TYPE"></a>MJS_FLOAT_ARRAY_TYPE</h3><div class=CBody><p>The base float array type.&nbsp;  By default, WebGLFloatArray.</p><p>mjs can work with any array-like elements, but if an array creation is requested, it will create an array of the type MJS_FLOAT_ARRAY_TYPE.&nbsp;  Also, the builtin constants such as (M4x4.I) will be of this type.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="V3"></a>V3</h2><div class=CBody><p>Methods for working with 3-element vectors.&nbsp;  A vector is represented by a 3-element array.&nbsp; Any valid JavaScript array type may be used, but if new vectors are created they are created using the configured MJS_FLOAT_ARRAY_TYPE.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#V3.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#V3.V3.$" id=link37 onMouseOver="ShowTip(event, 'tt1', 'link37')" onMouseOut="HideTip('tt1')">V3.$</a></td><td class=SDescription>Creates a new 3-element vector with the given values.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#V3.V3.clone" id=link38 onMouseOver="ShowTip(event, 'tt2', 'link38')" onMouseOut="HideTip('tt2')">V3.<wbr>clone</a></td><td class=SDescription>Clone the given 3-element vector.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#V3.V3.add" id=link39 onMouseOver="ShowTip(event, 'tt3', 'link39')" onMouseOut="HideTip('tt3')">V3.add</a></td><td class=SDescription>Perform r = a + b.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#V3.V3.sub" id=link40 onMouseOver="ShowTip(event, 'tt4', 'link40')" onMouseOut="HideTip('tt4')">V3.sub</a></td><td class=SDescription>Perform r = a - b.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#V3.V3.neg" id=link41 onMouseOver="ShowTip(event, 'tt5', 'link41')" onMouseOut="HideTip('tt5')">V3.neg</a></td><td class=SDescription>Perform r = - a.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#V3.V3.direction" id=link42 onMouseOver="ShowTip(event, 'tt6', 'link42')" onMouseOut="HideTip('tt6')">V3.<wbr>direction</a></td><td class=SDescription>Perform r = (a - b) / |a - b|. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#V3.V3.length" id=link43 onMouseOver="ShowTip(event, 'tt7', 'link43')" onMouseOut="HideTip('tt7')">V3.<wbr>length</a></td><td class=SDescription>Perform r = |a|.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#V3.V3.lengthSquard" >V3.<wbr>lengthSquard</a></td><td class=SDescription>Perform r = |a|*|a|.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#V3.V3.normalize" id=link44 onMouseOver="ShowTip(event, 'tt8', 'link44')" onMouseOut="HideTip('tt8')">V3.<wbr>normalize</a></td><td class=SDescription>Perform r = a / |a|.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#V3.V3.scale" id=link45 onMouseOver="ShowTip(event, 'tt9', 'link45')" onMouseOut="HideTip('tt9')">V3.<wbr>scale</a></td><td class=SDescription>Perform r = a * k.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#V3.V3.dot" id=link46 onMouseOver="ShowTip(event, 'tt10', 'link46')" onMouseOut="HideTip('tt10')">V3.dot</a></td><td class=SDescription>Perform r = dot(a, b).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#V3.V3.cross" id=link47 onMouseOver="ShowTip(event, 'tt11', 'link47')" onMouseOut="HideTip('tt11')">V3.<wbr>cross</a></td><td class=SDescription>Perform r = a x b.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="V3.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.$"></a>V3.$</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.$ = function V3_$(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new 3-element vector with the given values.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x,y,z</td><td class=CDLDescription>the 3 elements of the new vector.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new vector containing with the given argument values.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.clone"></a>V3.<wbr>clone</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.clone = function V3_clone(</td><td class=PParameter nowrap>a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Clone the given 3-element vector.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the 3-element vector to clone</td></tr></table><h4 class=CHeading>Returns</h4><p>A new vector with the same values as the passed-in one.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.add"></a>V3.add</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.add = function V3_add(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = a + b.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the first vector operand</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>the second vector operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.sub"></a>V3.sub</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.sub = function V3_sub(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = a - b.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the first vector operand</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>the second vector operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.neg"></a>V3.neg</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.neg = function V3_neg(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = - a.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the vector operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.direction"></a>V3.<wbr>direction</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.direction = function V3_direction(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = (a - b) / |a - b|.&nbsp;  The result is the normalized direction from a to b.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the first vector operand</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>the second vector operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.length"></a>V3.<wbr>length</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.length = function V3_length(</td><td class=PParameter nowrap>a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = |a|.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the vector operand</td></tr></table><h4 class=CHeading>Returns</h4><p>The length of the given vector.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.lengthSquard"></a>V3.<wbr>lengthSquard</h3><div class=CBody><p>Perform r = |a|*|a|.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the vector operand</td></tr></table><h4 class=CHeading>Returns</h4><p>The square of the length of the given vector.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.normalize"></a>V3.<wbr>normalize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.normalize = function V3_normalize(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = a / |a|.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the vector operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.scale"></a>V3.<wbr>scale</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.scale = function V3_scale(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = a * k.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the vector operand</td></tr><tr><td class=CDLEntry>k</td><td class=CDLDescription>a scalar value</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.dot"></a>V3.dot</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.dot = function V3_dot(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = dot(a, b).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the first vector operand</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>the second vector operand</td></tr></table><h4 class=CHeading>Returns</h4><p>The dot product of a and b.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="V3.V3.cross"></a>V3.<wbr>cross</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.cross = function V3_cross(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Perform r = a x b.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the first vector operand</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>the second vector operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional vector to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3-element vector with the result.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="M4x4"></a>M4x4</h2><div class=CBody><p>Methods for working with 4x4 matrices.&nbsp;  A matrix is represented by a 16-element array in column-major order.&nbsp;  Any valid JavaScript array type may be used, but if new matrices are created they are created using the configured MJS_FLOAT_ARRAY_TYPE.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#M4x4.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.$" id=link48 onMouseOver="ShowTip(event, 'tt12', 'link48')" onMouseOut="HideTip('tt12')">M4x4.$</a></td><td class=SDescription>Creates a new 4x4 matrix with the given values.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.clone" id=link49 onMouseOver="ShowTip(event, 'tt13', 'link49')" onMouseOut="HideTip('tt13')">M4x4.<wbr>clone</a></td><td class=SDescription>Clone the given 4x4 matrix.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.topLeft3x3" id=link50 onMouseOver="ShowTip(event, 'tt14', 'link50')" onMouseOut="HideTip('tt14')">M4x4.<wbr>topLeft3x3</a></td><td class=SDescription>Return the top left 3x3 matrix from the given 4x4 matrix m.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.inverseOrthonormal" id=link51 onMouseOver="ShowTip(event, 'tt15', 'link51')" onMouseOut="HideTip('tt15')">M4x4.<wbr>inverseOrthonormal</a></td><td class=SDescription>Computes the inverse of the given matrix m, assuming that the matrix is orthonormal.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.inverseTo3x3" id=link52 onMouseOver="ShowTip(event, 'tt16', 'link52')" onMouseOut="HideTip('tt16')">M4x4.<wbr>inverseTo3x3</a></td><td class=SDescription>Computes the inverse of the given matrix m, but calculates only the top left 3x3 values of the result.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.makeFrustum" id=link53 onMouseOver="ShowTip(event, 'tt17', 'link53')" onMouseOut="HideTip('tt17')">M4x4.<wbr>makeFrustum</a></td><td class=SDescription>Creates a matrix for a projection frustum with the given parameters.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makePerspective" id=link54 onMouseOver="ShowTip(event, 'tt18', 'link54')" onMouseOut="HideTip('tt18')">M4x4.<wbr>makePerspective</a></td><td class=SDescription>Creates a matrix for a perspective projection with the given parameters.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.makeOrtho" id=link55 onMouseOver="ShowTip(event, 'tt19', 'link55')" onMouseOut="HideTip('tt19')">M4x4.<wbr>makeOrtho</a></td><td class=SDescription>Creates a matrix for an orthogonal frustum projection with the given parameters.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeOrtho" id=link56 onMouseOver="ShowTip(event, 'tt19', 'link56')" onMouseOut="HideTip('tt19')">M4x4.<wbr>makeOrtho</a></td><td class=SDescription>Creates a matrix for a 2D orthogonal frustum projection with the given parameters. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.mul" id=link57 onMouseOver="ShowTip(event, 'tt20', 'link57')" onMouseOut="HideTip('tt20')">M4x4.mul</a></td><td class=SDescription>Performs r = a * b.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeRotate" id=link58 onMouseOver="ShowTip(event, 'tt21', 'link58')" onMouseOut="HideTip('tt21')">M4x4.<wbr>makeRotate</a></td><td class=SDescription>Creates a transformation matrix for rotation by angle radians about the 3-element vector axis.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.rotate" id=link59 onMouseOver="ShowTip(event, 'tt22', 'link59')" onMouseOut="HideTip('tt22')">M4x4.<wbr>rotate</a></td><td class=SDescription>Concatenates a rotation of angle radians about the axis to the give matrix m.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeScale3" id=link60 onMouseOver="ShowTip(event, 'tt23', 'link60')" onMouseOut="HideTip('tt23')">M4x4.<wbr>makeScale3</a></td><td class=SDescription>Creates a transformation matrix for scaling by 3 scalar values, one for each of the x, y, and z directions.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.makeScale1" id=link61 onMouseOver="ShowTip(event, 'tt24', 'link61')" onMouseOut="HideTip('tt24')">M4x4.<wbr>makeScale1</a></td><td class=SDescription>Creates a transformation matrix for a uniform scale by a single scalar value.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeScale" id=link62 onMouseOver="ShowTip(event, 'tt25', 'link62')" onMouseOut="HideTip('tt25')">M4x4.<wbr>makeScale</a></td><td class=SDescription>Creates a transformation matrix for scaling each of the x, y, and z axes by the amount given in the corresponding element of the 3-element vector.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.scale3" id=link63 onMouseOver="ShowTip(event, 'tt26', 'link63')" onMouseOut="HideTip('tt26')">M4x4.<wbr>scale3</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.scale1" id=link64 onMouseOver="ShowTip(event, 'tt27', 'link64')" onMouseOut="HideTip('tt27')">M4x4.<wbr>scale1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.scale1" >M4x4.<wbr>scale1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeTranslate3" id=link65 onMouseOver="ShowTip(event, 'tt28', 'link65')" onMouseOut="HideTip('tt28')">M4x4.<wbr>makeTranslate3</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.makeTranslate1" id=link66 onMouseOver="ShowTip(event, 'tt29', 'link66')" onMouseOut="HideTip('tt29')">M4x4.<wbr>makeTranslate1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeTranslate" id=link67 onMouseOver="ShowTip(event, 'tt30', 'link67')" onMouseOut="HideTip('tt30')">M4x4.<wbr>makeTranslate</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.translate3" id=link68 onMouseOver="ShowTip(event, 'tt31', 'link68')" onMouseOut="HideTip('tt31')">M4x4.<wbr>translate3</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.translate1" id=link69 onMouseOver="ShowTip(event, 'tt32', 'link69')" onMouseOut="HideTip('tt32')">M4x4.<wbr>translate1</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.translate" id=link70 onMouseOver="ShowTip(event, 'tt33', 'link70')" onMouseOut="HideTip('tt33')">M4x4.<wbr>translate</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#M4x4.M4x4.makeLookAt" id=link71 onMouseOver="ShowTip(event, 'tt34', 'link71')" onMouseOut="HideTip('tt34')">M4x4.<wbr>makeLookAt</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#M4x4.M4x4.transpose" id=link72 onMouseOver="ShowTip(event, 'tt35', 'link72')" onMouseOut="HideTip('tt35')">M4x4.<wbr>transpose</a></td><td class=SDescription></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="M4x4.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.$"></a>M4x4.$</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.$ = function M4x4_$(</td><td class=PParameter nowrap>m00,</td></tr><tr><td></td><td class=PParameter nowrap>m01,</td></tr><tr><td></td><td class=PParameter nowrap>m02,</td></tr><tr><td></td><td class=PParameter nowrap>m03,</td></tr><tr><td></td><td class=PParameter nowrap>m04,</td></tr><tr><td></td><td class=PParameter nowrap>m05,</td></tr><tr><td></td><td class=PParameter nowrap>m06,</td></tr><tr><td></td><td class=PParameter nowrap>m07,</td></tr><tr><td></td><td class=PParameter nowrap>m08,</td></tr><tr><td></td><td class=PParameter nowrap>m09,</td></tr><tr><td></td><td class=PParameter nowrap>m10,</td></tr><tr><td></td><td class=PParameter nowrap>m11,</td></tr><tr><td></td><td class=PParameter nowrap>m12,</td></tr><tr><td></td><td class=PParameter nowrap>m13,</td></tr><tr><td></td><td class=PParameter nowrap>m14,</td></tr><tr><td></td><td class=PParameter nowrap>m15</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new 4x4 matrix with the given values.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>m00..m15</td><td class=CDLDescription>the 16 elements of the new matrix.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new matrix filled with the given argument values.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.clone"></a>M4x4.<wbr>clone</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.clone = function M4x4_clone(</td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Clone the given 4x4 matrix.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>m</td><td class=CDLDescription>the 4x4 matrix to clone</td></tr></table><h4 class=CHeading>Returns</h4><p>A new matrix with the same values as the passed-in one.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.topLeft3x3"></a>M4x4.<wbr>topLeft3x3</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.topLeft3x3 = function M4x4_topLeft3x3(</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Return the top left 3x3 matrix from the given 4x4 matrix m.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>m</td><td class=CDLDescription>the matrix</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 3x3 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3x3 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.inverseOrthonormal"></a>M4x4.<wbr>inverseOrthonormal</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.inverseOrthonormal = function M4x4_inverseOrthonormal(</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Computes the inverse of the given matrix m, assuming that the matrix is orthonormal.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>m</td><td class=CDLDescription>the matrix</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.inverseTo3x3"></a>M4x4.<wbr>inverseTo3x3</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.inverseTo3x3 = function M4x4_inverseTo3x3(</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Computes the inverse of the given matrix m, but calculates only the top left 3x3 values of the result.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>m</td><td class=CDLDescription>the matrix</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 3x3 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 3x3 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeFrustum"></a>M4x4.<wbr>makeFrustum</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeFrustum = function M4x4_makeFrustum(</td><td class=PParameter nowrap>left,</td></tr><tr><td></td><td class=PParameter nowrap>right,</td></tr><tr><td></td><td class=PParameter nowrap>bottom,</td></tr><tr><td></td><td class=PParameter nowrap>top,</td></tr><tr><td></td><td class=PParameter nowrap>znear,</td></tr><tr><td></td><td class=PParameter nowrap>zfar,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a matrix for a projection frustum with the given parameters.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>left</td><td class=CDLDescription>the left coordinate of the frustum right- the right coordinate of the frustum</td></tr><tr><td class=CDLEntry>bottom</td><td class=CDLDescription>the bottom coordinate of the frustum</td></tr><tr><td class=CDLEntry>top</td><td class=CDLDescription>the top coordinate of the frustum</td></tr><tr><td class=CDLEntry>znear</td><td class=CDLDescription>the near z distance of the frustum</td></tr><tr><td class=CDLEntry>zfar</td><td class=CDLDescription>the far z distance of the frustum</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the projection matrix.&nbsp; Otherwise, returns a new 4x4 matrix.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makePerspective"></a>M4x4.<wbr>makePerspective</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makePerspective = function M4x4_makePerspective (</td><td class=PParameter nowrap>fovy,</td></tr><tr><td></td><td class=PParameter nowrap>aspect,</td></tr><tr><td></td><td class=PParameter nowrap>znear,</td></tr><tr><td></td><td class=PParameter nowrap>zfar,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a matrix for a perspective projection with the given parameters.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>fovy</td><td class=CDLDescription>field of view in the y axis, in degrees</td></tr><tr><td class=CDLEntry>aspect</td><td class=CDLDescription>aspect ratio</td></tr><tr><td class=CDLEntry>znear</td><td class=CDLDescription>the near z distance of the projection</td></tr><tr><td class=CDLEntry>zfar</td><td class=CDLDescription>the far z distance of the projection</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the projection matrix.&nbsp; Otherwise, returns a new 4x4 matrix.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeOrtho"></a>M4x4.<wbr>makeOrtho</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeOrtho = function M4x4_makeOrtho (</td><td class=PParameter nowrap>left,</td></tr><tr><td></td><td class=PParameter nowrap>right,</td></tr><tr><td></td><td class=PParameter nowrap>bottom,</td></tr><tr><td></td><td class=PParameter nowrap>top,</td></tr><tr><td></td><td class=PParameter nowrap>znear,</td></tr><tr><td></td><td class=PParameter nowrap>zfar,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a matrix for an orthogonal frustum projection with the given parameters.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>left</td><td class=CDLDescription>the left coordinate of the frustum right- the right coordinate of the frustum</td></tr><tr><td class=CDLEntry>bottom</td><td class=CDLDescription>the bottom coordinate of the frustum</td></tr><tr><td class=CDLEntry>top</td><td class=CDLDescription>the top coordinate of the frustum</td></tr><tr><td class=CDLEntry>znear</td><td class=CDLDescription>the near z distance of the frustum</td></tr><tr><td class=CDLEntry>zfar</td><td class=CDLDescription>the far z distance of the frustum</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the projection matrix.&nbsp; Otherwise, returns a new 4x4 matrix.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeOrtho"></a>M4x4.<wbr>makeOrtho</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeOrtho2D = function M4x4_makeOrtho2D (</td><td class=PParameter nowrap>left,</td></tr><tr><td></td><td class=PParameter nowrap>right,</td></tr><tr><td></td><td class=PParameter nowrap>bottom,</td></tr><tr><td></td><td class=PParameter nowrap>top,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a matrix for a 2D orthogonal frustum projection with the given parameters. znear and zfar are assumed to be -1 and 1, respectively.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>left</td><td class=CDLDescription>the left coordinate of the frustum right- the right coordinate of the frustum</td></tr><tr><td class=CDLEntry>bottom</td><td class=CDLDescription>the bottom coordinate of the frustum</td></tr><tr><td class=CDLEntry>top</td><td class=CDLDescription>the top coordinate of the frustum</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the projection matrix.&nbsp; Otherwise, returns a new 4x4 matrix.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.mul"></a>M4x4.mul</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.mul = function M4x4_mul(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Performs r = a * b.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the first matrix operand</td></tr><tr><td class=CDLEntry>b</td><td class=CDLDescription>the second matrix operand</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeRotate"></a>M4x4.<wbr>makeRotate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeRotate = function M4x4_makeRotate(</td><td class=PParameter nowrap>angle,</td></tr><tr><td></td><td class=PParameter nowrap>axis,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a transformation matrix for rotation by angle radians about the 3-element vector axis.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>angle</td><td class=CDLDescription>the angle of rotation, in radians</td></tr><tr><td class=CDLEntry>axis</td><td class=CDLDescription>the axis around which the rotation is performed, a 3-element vector</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the matrix.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.rotate"></a>M4x4.<wbr>rotate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.rotate = function M4x4_rotate(</td><td class=PParameter nowrap>angle,</td></tr><tr><td></td><td class=PParameter nowrap>axis,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Concatenates a rotation of angle radians about the axis to the give matrix m.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>angle</td><td class=CDLDescription>the angle of rotation, in radians</td></tr><tr><td class=CDLEntry>axis</td><td class=CDLDescription>the axis around which the rotation is performed, a 3-element vector</td></tr><tr><td class=CDLEntry>m</td><td class=CDLDescription>the matrix to concatenate the rotation to</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after performing the operation.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeScale3"></a>M4x4.<wbr>makeScale3</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeScale3 = function M4x4_makeScale3(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a transformation matrix for scaling by 3 scalar values, one for each of the x, y, and z directions.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x</td><td class=CDLDescription>the scale for the x axis</td></tr><tr><td class=CDLEntry>y</td><td class=CDLDescription>the scale for the y axis</td></tr><tr><td class=CDLEntry>z</td><td class=CDLDescription>the scale for the z axis</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the matrix.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeScale1"></a>M4x4.<wbr>makeScale1</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeScale1 = function M4x4_makeScale1(</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a transformation matrix for a uniform scale by a single scalar value.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>k</td><td class=CDLDescription>the scale factor</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the matrix.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeScale"></a>M4x4.<wbr>makeScale</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeScale = function M4x4_makeScale(</td><td class=PParameter nowrap>v,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a transformation matrix for scaling each of the x, y, and z axes by the amount given in the corresponding element of the 3-element vector.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>v</td><td class=CDLDescription>the 3-element vector containing the scale factors</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>optional 4x4 matrix to store the result in</td></tr></table><h4 class=CHeading>Returns</h4><p>If r is specified, returns r after creating the matrix.&nbsp; Otherwise, returns a new 4x4 matrix with the result.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.scale3"></a>M4x4.<wbr>scale3</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.scale3 = function M4x4_scale3(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.scale1"></a>M4x4.<wbr>scale1</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.scale1 = function M4x4_scale1(</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.scale1"></a>M4x4.<wbr>scale1</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeTranslate3"></a>M4x4.<wbr>makeTranslate3</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeTranslate3 = function M4x4_makeTranslate3(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeTranslate1"></a>M4x4.<wbr>makeTranslate1</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeTranslate1 = function M4x4_makeTranslate1 (</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeTranslate"></a>M4x4.<wbr>makeTranslate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeTranslate = function M4x4_makeTranslate (</td><td class=PParameter nowrap>v,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.translate3"></a>M4x4.<wbr>translate3</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.translate3 = function M4x4_translate3 (</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.translate1"></a>M4x4.<wbr>translate1</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.translate1 = function M4x4_translate1 (</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.translate"></a>M4x4.<wbr>translate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.translate = function M4x4_translate (</td><td class=PParameter nowrap>v,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.makeLookAt"></a>M4x4.<wbr>makeLookAt</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeLookAt = function M4x4_makeLookAt (</td><td class=PParameter nowrap>eye,</td></tr><tr><td></td><td class=PParameter nowrap>center,</td></tr><tr><td></td><td class=PParameter nowrap>up,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="M4x4.M4x4.transpose"></a>M4x4.<wbr>transpose</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.transpose = function M4x4_transpose (</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile id=MSelected>mjs</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Constants.html">Constants</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.$ = function V3_$(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a new 3-element vector with the given values.</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.clone = function V3_clone(</td><td class=PParameter nowrap>a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Clone the given 3-element vector.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.add = function V3_add(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = a + b.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.sub = function V3_sub(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = a - b.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.neg = function V3_neg(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = - a.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.direction = function V3_direction(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = (a - b) / |a - b|. </div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.length = function V3_length(</td><td class=PParameter nowrap>a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = |a|.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.normalize = function V3_normalize(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = a / |a|.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.scale = function V3_scale(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = a * k.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.dot = function V3_dot(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = dot(a, b).</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>V3.cross = function V3_cross(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Perform r = a x b.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.$ = function M4x4_$(</td><td class=PParameter nowrap>m00,</td></tr><tr><td></td><td class=PParameter nowrap>m01,</td></tr><tr><td></td><td class=PParameter nowrap>m02,</td></tr><tr><td></td><td class=PParameter nowrap>m03,</td></tr><tr><td></td><td class=PParameter nowrap>m04,</td></tr><tr><td></td><td class=PParameter nowrap>m05,</td></tr><tr><td></td><td class=PParameter nowrap>m06,</td></tr><tr><td></td><td class=PParameter nowrap>m07,</td></tr><tr><td></td><td class=PParameter nowrap>m08,</td></tr><tr><td></td><td class=PParameter nowrap>m09,</td></tr><tr><td></td><td class=PParameter nowrap>m10,</td></tr><tr><td></td><td class=PParameter nowrap>m11,</td></tr><tr><td></td><td class=PParameter nowrap>m12,</td></tr><tr><td></td><td class=PParameter nowrap>m13,</td></tr><tr><td></td><td class=PParameter nowrap>m14,</td></tr><tr><td></td><td class=PParameter nowrap>m15</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a new 4x4 matrix with the given values.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.clone = function M4x4_clone(</td><td class=PParameter nowrap>m</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Clone the given 4x4 matrix.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.topLeft3x3 = function M4x4_topLeft3x3(</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Return the top left 3x3 matrix from the given 4x4 matrix m.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.inverseOrthonormal = function M4x4_inverseOrthonormal(</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Computes the inverse of the given matrix m, assuming that the matrix is orthonormal.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.inverseTo3x3 = function M4x4_inverseTo3x3(</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Computes the inverse of the given matrix m, but calculates only the top left 3x3 values of the result.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeFrustum = function M4x4_makeFrustum(</td><td class=PParameter nowrap>left,</td></tr><tr><td></td><td class=PParameter nowrap>right,</td></tr><tr><td></td><td class=PParameter nowrap>bottom,</td></tr><tr><td></td><td class=PParameter nowrap>top,</td></tr><tr><td></td><td class=PParameter nowrap>znear,</td></tr><tr><td></td><td class=PParameter nowrap>zfar,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a matrix for a projection frustum with the given parameters.</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makePerspective = function M4x4_makePerspective (</td><td class=PParameter nowrap>fovy,</td></tr><tr><td></td><td class=PParameter nowrap>aspect,</td></tr><tr><td></td><td class=PParameter nowrap>znear,</td></tr><tr><td></td><td class=PParameter nowrap>zfar,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a matrix for a perspective projection with the given parameters.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeOrtho = function M4x4_makeOrtho (</td><td class=PParameter nowrap>left,</td></tr><tr><td></td><td class=PParameter nowrap>right,</td></tr><tr><td></td><td class=PParameter nowrap>bottom,</td></tr><tr><td></td><td class=PParameter nowrap>top,</td></tr><tr><td></td><td class=PParameter nowrap>znear,</td></tr><tr><td></td><td class=PParameter nowrap>zfar,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a matrix for an orthogonal frustum projection with the given parameters.</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.mul = function M4x4_mul(</td><td class=PParameter nowrap>a,</td></tr><tr><td></td><td class=PParameter nowrap>b,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Performs r = a * b.</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeRotate = function M4x4_makeRotate(</td><td class=PParameter nowrap>angle,</td></tr><tr><td></td><td class=PParameter nowrap>axis,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a transformation matrix for rotation by angle radians about the 3-element vector axis.</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.rotate = function M4x4_rotate(</td><td class=PParameter nowrap>angle,</td></tr><tr><td></td><td class=PParameter nowrap>axis,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Concatenates a rotation of angle radians about the axis to the give matrix m.</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeScale3 = function M4x4_makeScale3(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a transformation matrix for scaling by 3 scalar values, one for each of the x, y, and z directions.</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeScale1 = function M4x4_makeScale1(</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a transformation matrix for a uniform scale by a single scalar value.</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeScale = function M4x4_makeScale(</td><td class=PParameter nowrap>v,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a transformation matrix for scaling each of the x, y, and z axes by the amount given in the corresponding element of the 3-element vector.</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.scale3 = function M4x4_scale3(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.scale1 = function M4x4_scale1(</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeTranslate3 = function M4x4_makeTranslate3(</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeTranslate1 = function M4x4_makeTranslate1 (</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeTranslate = function M4x4_makeTranslate (</td><td class=PParameter nowrap>v,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.translate3 = function M4x4_translate3 (</td><td class=PParameter nowrap>x,</td></tr><tr><td></td><td class=PParameter nowrap>y,</td></tr><tr><td></td><td class=PParameter nowrap>z,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.translate1 = function M4x4_translate1 (</td><td class=PParameter nowrap>k,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.translate = function M4x4_translate (</td><td class=PParameter nowrap>v,</td></tr><tr><td></td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.makeLookAt = function M4x4_makeLookAt (</td><td class=PParameter nowrap>eye,</td></tr><tr><td></td><td class=PParameter nowrap>center,</td></tr><tr><td></td><td class=PParameter nowrap>up,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>M4x4.transpose = function M4x4_transpose (</td><td class=PParameter nowrap>m,</td></tr><tr><td></td><td class=PParameter nowrap>r</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>